﻿import 'package:star_author/generated/json/base/json_convert_content.dart';
import 'package:star_author/widgets/dialog/notice_dialog/model/notice_entity.dart';

NoticeEntity $NoticeEntityFromJson(Map<String, dynamic> json) {
	final NoticeEntity noticeEntity = NoticeEntity();
	final List<NoticeData>? data = jsonConvert.convertListNotNull<NoticeData>(json['data']);
	if (data != null) {
		noticeEntity.data = data;
	}
	final bool? announcement_read = jsonConvert.convert<bool>(json['announcement_read']);
	if (announcement_read != null) {
		noticeEntity.announcement_read = announcement_read;
	}
	return noticeEntity;
}

Map<String, dynamic> $NoticeEntityToJson(NoticeEntity entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['data'] =  entity.data?.map((v) => v.toJson()).toList();
	data['announcement_read'] = entity.announcement_read;
	return data;
}

NoticeData $NoticeDataFromJson(Map<String, dynamic> json) {
	final NoticeData noticeData = NoticeData();
	final int? id = jsonConvert.convert<int>(json['id']);
	if (id != null) {
		noticeData.id = id;
	}
	final String? body = jsonConvert.convert<String>(json['body']);
	if (body != null) {
		noticeData.body = body;
	}
	final bool? effective = jsonConvert.convert<bool>(json['effective']);
	if (effective != null) {
		noticeData.effective = effective;
	}
	final String? created_at = jsonConvert.convert<String>(json['created_at']);
	if (created_at != null) {
		noticeData.created_at = created_at;
	}
	return noticeData;
}

Map<String, dynamic> $NoticeDataToJson(NoticeData entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['id'] = entity.id;
	data['body'] = entity.body;
	data['effective'] = entity.effective;
	data['created_at'] = entity.created_at;
	return data;
}